package zju.ccnt.rest.api;

import zju.ccnt.rest.domain.BusinessUser;
import zju.ccnt.rest.service.validation.NumericalLikeValidator;
import zju.ccnt.rest.service.validation.ValidNumericalLike;
import zju.ccnt.oauth2.user.api.ApiUser;

import javax.validation.constraints.NotNull;

/**
 * Created by zha on 14/11/2.
 */
public class ApiBusinessUser extends ApiUser{

    private String address;
    @NotNull
    @ValidNumericalLike(type = NumericalLikeValidator.NumericalEnum.IP)
    private String router;
    @ValidNumericalLike(type = NumericalLikeValidator.NumericalEnum.PHONE)
    private String phone;
    private String parent;
    private String id;

    public ApiBusinessUser(){}

    public ApiBusinessUser(BusinessUser businessUser){
        super(businessUser.getId(), businessUser.getEmail(), businessUser.getName());
        this.address = businessUser.getAddress();
        this.router = businessUser.getRouter();
        this.phone = businessUser.getPhone();
        this.parent = businessUser.getParent();
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getRouter() {
        return router;
    }

    public void setRouter(String router) {
        this.router = router;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getParent() {
        return parent;
    }

    public void setParent(String parent) {
        this.parent = parent;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }
}
